package com.hui.platform.falseworkapi.service.base.mail.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * 邮件 模块 Swagger2接口文档配置
 *
 * @author hui
 * @date 2020/05/07
 */
@Configuration
public class MailSwaggerConfig {

    /**
     * 包接口位置
     */
    private static final String INTERFACE_PACKAGE = "com.hui.platform.falseworkapi.service.base.mail.controller";

    @Bean
    public Docket mailApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("邮件模块-接口集")
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage(INTERFACE_PACKAGE))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("邮件模块")
                .description("接口文档详细信息-邮件模块")
                .termsOfServiceUrl("")
                .version("1.0")
                .build();
    }

}
